package com.xiaoshuidi.cloud.module.bpm.service.reserveapartmentconfig;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.module.bpm.api.reserveapartmentconfig.vo.CreateReserveApartmentConfigReqVO;
import com.xiaoshuidi.cloud.module.bpm.controller.admin.reserveapartmentconfig.vo.ReserveApartmentConfigPageReqVO;
import com.xiaoshuidi.cloud.module.bpm.controller.admin.reserveapartmentconfig.vo.ReserveApartmentConfigPageRespVO;
import com.xiaoshuidi.cloud.module.bpm.controller.admin.reserveapartmentconfig.vo.SetupReserveNumReqVO;
import com.xiaoshuidi.cloud.module.bpm.dal.dataobject.reserveapartmentconfig.ReserveApartmentConfig;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 门店预约配置 服务类
 * </p>
 *
 * @author hans.zhang
 * @since 2023-12-01
 */
public interface ReserveApartmentConfigService extends IService<ReserveApartmentConfig> {

    CommonResult<PageResult<ReserveApartmentConfigPageRespVO>> getPage(ReserveApartmentConfigPageReqVO reqVO);

    /**
     * 设置预约人数
     * @param reqVO
     * @return
     */
    CommonResult<Boolean> setupReserveNum(SetupReserveNumReqVO reqVO);

    /**
     * 根据门店id和时间段获取配置信息
     * @param apartmentId 门店id
     * @param timePeriod 时间段
     */
    ReserveApartmentConfig getByApartmentIdAndTimePeriod(Long apartmentId, Integer timePeriod);

    List<ReserveApartmentConfig> getByApartmentId(@NotNull(message = "门店id不能为空") Long apartmentId);

    Boolean createReserveApartmentConfig(CreateReserveApartmentConfigReqVO reqVO);

    /**
     * 预约人数回显
     * @param apartmentId
     * @return
     */
    Map<Integer, Integer> getReserveNum(Long apartmentId);
}
